<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>可发起流程列表</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
<form id="flowForm">
	<div id="ligergrid1" class="sq-grid"></div>
</form>
</div>

<script type="text/javascript">
var _modelTyp = '${modelTyp}';
var grid;
$(function(){
	grid = $("#ligergrid1").ligerGrid({
    	url: '<%=path%>/flow/flow/initForStartList.do',
    	method : 'get',
    	parms:{
    		modelTyp:_modelTyp
    	},
        columns: [
            { display: '流程及版本', minWidth: 500 , 
            	render:function(rowdata,index,value){
            		var h = rowdata.procDefNm + '-' + rowdata.procDefVers;
            		return h;
                }
            },
        ],
        usePager: true,
        pageSize:10,
        root:'rows',
        record:'total',
        hideLoadButton : true,
        width: '100%',
        //isScroll: false,
        height:'100%',
        heightDiff:-2,
        rownumbers:true,
        usePagerOnLessPagesize: false
    });
    //grid.setHeight(100);
    //SET_popupIframeHeight();
})
//定义父级调用事件
frameElement.dialog.onOk = function () {
     save();
}
frameElement.dialog.onCancel = function () {
     frameElement.dialog.close();
}
function save(){
	var selectedRows = grid.getSelectedRows();
	if(selectedRows.length != 1){
		$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_ONLY_A_ROW , SQ_type: "warning" });
		return;
	}
	var _procDefKey = selectedRows[0].procDefKey;//流程定义KEY
	var _procDefId = selectedRows[0].procDefId;//流程定义ID
	var _procNo = selectedRows[0].procNo;//流程编号前缀
	frameElement.dialog._DATA={procDefKey:_procDefKey,procDefId:_procDefId,procNo:_procNo}; //给父窗口的dialog传参
	frameElement.dialog.close();
}
</script>



</body>
</html>
